<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>

<body>

  <div id="app">
    <div @click="divClick">
      aaaaa
      <button @click.stop="btnClick">按钮</button>
    </div>

    <br>
    <form action="baidu">
      <input type="submit" value="提交" @click.prevent="submitClick">
    </form>

    <br>
    <!-- 监听某个键盘的键帽 -->
    <input type="text" @keyup.enter="keyUp">

    <!-- once -->
    <button @click.once="btnClick">按了多少次都一样</button>
  </div>

  <script src="../js/vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {

      },
      methods: {
        btnClick() {
          console.log("btnClick");
        },
        divClick() {
          console.log("divClick");
        },
        submitClick() {
          console.log("submitClick");
        },
        keyUp() {
          console.log("keyUp");
        }
      }
    })
  </script>
</body>

</html>